<?php
if(!defined('IN_SITE')) exit('Access Denied');
include_once("include/data/configure.data.php");//加载配置文件
$__TEMPLATE = $CONFIGURE["tp"] ? $CONFIGURE["tp"] : 'default';//默认模板名称
$_CACHEDIR     =  'cache/'.$mod.'/'.$__TEMPLATE;
$_TEMPLATESDIR =  'templates/'.$__TEMPLATE;
$_TEMPLATESDIR = file_exists($_TEMPLATESDIR) ? $_TEMPLATESDIR : 'templates/default';
$_THEME =  'themes/'.$__TEMPLATE;
$_THEME = file_exists($_THEME) ? $_THEME : 'themes/default';
//链接样式判断
if($act=="index")
{
    $style["view"] = "view-select";
    $style["message"] = "add";
    $style["manage"] = "admin";  
}else if($act=="message")
{
    $style["view"] = "view";
    $style["message"] = "add-select";
    $style["manage"] = "admin";  
    
}else if($act=="manage")
{
    $style["view"] = "view";
    $style["message"] = "add";
    $style["manage"] = "admin-select";  
    
}
//留言统计
if ($_SESSION['___isadmin']) 
	$sum = $db->SelectS("select count(id) as sum from message where fid=0",1);
else 
	$sum = $db->SelectS("select count(id) as sum from message where fid=0 and ispower=0",1);

$today_start = mktime(0,0,0,date('m'),date('d'),date('Y'));
$today_end = mktime(0,0,0,date('m'),date('d')+1,date('Y'));

if ($_SESSION['___isadmin']) 
	$todaysum = $db->SelectS("select count(id) as sum from message where fid=0 and createtime BETWEEN ".$today_start." and ".$today_end,1);
else 
	$todaysum = $db->SelectS("select count(id) as sum from message where fid=0 and ispower=0 and createtime BETWEEN ".$today_start." and ".$today_end,1);


/*
    内网IP
*/

/*
    禁止IP访问
*/
if(is_array($CONFIGURE["ip"]))
{
    $ip = $_SERVER['REMOTE_ADDR'];
    if(in_array($ip,$CONFIGURE["ip"]))
    {
        stop("您的IP被禁止访问");
      
    }
    
}
?>
